package dk.marten.ibdrecord.graf;

import java.util.List;

import android.graphics.Color;

public class GrafDataset {
	public enum GrafType { Graf , Sojle };
    public List<GrafData> GrafData;
    public double MaxValue = 0;
    public double MinValue = 0;

    public double MinDatoTicks = 0;//DateTime.Now.Ticks;
    public Color Farve;

    public GrafType Typen = GrafType.Sojle;

    public int PixelOffsetX = 0;
    public int PixelOffsetY = 0;
    public int StrokeThickness = 1;

    public String Titel = "";


    public GrafDataset()
    {
    }

    public GrafDataset(List<GrafData> grafData) {
        MaxValue = 10;
        GrafData = grafData;
        //Farve = Colors.Gray;
        SetMinMax();
    }
    
    public GrafDataset(List<GrafData> grafData,Color farve)
    {
        MaxValue = 100;
        GrafData = grafData;
        Farve = farve;
        SetMinMax();
    }

    public GrafDataset(List<GrafData> grafData, Color farve, Double maxValue)
    {
        GrafData = grafData;
        SetMinMax();
        MaxValue = maxValue;
        Farve = farve;
    }

    public void SetMinMax()
    { 
        for (GrafData data : GrafData) {
            MaxValue = Math.max(MaxValue, data.Value);
            MinValue = Math.min(MinValue, data.Value);
            MinDatoTicks = Math.min(MinDatoTicks, data.DatoTick);
        }
    }
    

}
